package com.bulletelc.apollopre.framework;

import java.io.Serializable;
import java.util.List;

/**
 * author: lhl
 * time  : 2017/10/22
 * desc  : 网络请求结果 基类
 */

public class BaseResponse<D,E,L> implements Serializable{
    /**
     * 作用:序列化时为了保持版本的兼容性，即在版本升级时反序列化仍保持对象的唯一性
     */
    private static final long serialVersionUID = 3164610466444572408L;


    /**
     * 数据
     */
    private D data;

    /**
     * 元数据信息
     */
    private Meta meta;

    /**
     * 链接
     */
    private L links;

    public D getData() {
        return data;
    }

    public void setData(D data) {
        this.data = data;
    }

    public Meta getMeta() {
        return meta;
    }

    public void setMeta(Meta meta) {
        this.meta = meta;
    }

    public L getLinks() {
        return links;
    }

    public void setLinks(L links) {
        this.links = links;
    }

    /**
     * 网络请求结果元数据信息
     */
    public class Meta implements Serializable{
        private static final long serialVersionUID = -845710903663216989L;
        /**
         * code : 000
         * msg : Operation completed.
         * time : 2017-12-01 08:38:24
         * extraData : {}
         */

        private String code;
        private String msg;
        private String time;
        private E extraData;

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }

        public String getTime() {
            return time;
        }

        public void setTime(String time) {
            this.time = time;
        }

        public E getExtraData() {
            return extraData;
        }

        public void setExtraData(E extraData) {
            this.extraData = extraData;
        }
    }
}
